package schoolsys.service.impl;







import schoolsys.dao.StudentDao;
import schoolsys.dao.impl.StudentDaoImpl;
import schoolsys.entity.Student;
import schoolsys.service.StudentService;

import java.util.List;

public class StudentServiceImpl implements StudentService {
    private StudentDao studentDao;
    public StudentServiceImpl(){
        studentDao=new StudentDaoImpl();
    }
    @Override
    public List getStuByName(String stuName, int sex) {
        return studentDao.getStuByName(stuName,sex);
    }

    @Override
    public Student getStuByNo(String studentNo) {
        return studentDao.getStuByNo(studentNo);
    }

    @Override
    public List<Student> getStuByNameAll(String studentName ,String studentNo,int currentPage,int pageSize) {
        return studentDao.getStuByNameAll(studentName ,studentNo,currentPage,pageSize);
    }

    @Override
    public boolean addStu(Student stu) {
        return studentDao.addStu(stu);
    }

    @Override
    public int deleteStuByNo(long stuNo) {
        return studentDao.deleteStuByNo(stuNo);
    }

    @Override
    public int updateStuByNo(Student stu) {
        return studentDao.updateStuByNo(stu);
    }

    @Override
    public int getTotalCount(String studentName, String studentNo) {
        return studentDao.getTotalCount(studentName,studentNo);
    }


}
